import 'dart:convert';

//用户消费记录
class RecordModel {
  int? id;

  ///类型：1-充值 2-解锁消费
  int? type;

  int? coin;

  ///添加时间
  String? createdAt;

  RecordModel({this.id, this.type, this.coin, this.createdAt});

  factory RecordModel.fromRawJson(String str) =>
      RecordModel.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory RecordModel.fromJson(Map<String, dynamic> json) => RecordModel(
    id: json["id"],
    type: json["type"],
    coin: json["coin"],
    createdAt: json["created_at"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "type": type,
    "coin": coin,
    "created_at": createdAt,
  };
}
